import React, { useEffect, useState } from 'react';
import { Slider } from 'antd';
import { formatDate } from '@/utils'

export default function ProgressBar() {
  let time = 0;
  // eslint-disable-next-line no-unused-vars
  const [currentTime, setCurrent] = useState(0); // 当前播放时间
  const [progress, setProgress] = useState(0); // 进度条
  const durationTime = formatDate(currentTime, "mm:ss");

  useEffect(() => {
    setTimeout(() => {
      setProgress(time++)
    }, 60);
  })
  return (
    <div className="progress">
      <span className="time">{ durationTime }</span>
      {/* start进度条 */}
      <div className="progress-bar">
        <Slider defaultValue={progress} tooltipVisible={ false }/>
        {/* start滑块 */}
        <div className="slider-block"></div>
        {/* end滑块 */}
      </div>
      {/* end进度条 */}
      <span className="time">03:44</span>
    </div>
  )
}

